package com.flash.DayProcessing.service.impl;

import com.flash.BusinessData.entity.DealData;
import com.flash.DayProcessing.entity.assetValuationDate;
import com.flash.DayProcessing.entity.AssetValuationMjoinS;
import com.flash.DayProcessing.mapper.assetValuationMapper;
import com.flash.DayProcessing.service.AssetValuationService;
import com.flash.InventoryManagement.entity.CashAccrualStock;
import com.flash.InventoryManagement.entity.SecurityAccrualStock;
import com.flash.TAManagement.entity.Ta;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class assetValuationImpl implements AssetValuationService {
    @Autowired
    assetValuationMapper assetValuationMapper;
    @Override
    public List<assetValuationDate> selectTable() {
        //插入估值类型和估值状态
        assetValuationDate assetValuation = new assetValuationDate(1,"证券估值增值","未估值");
        assetValuationDate assetValuation1 = new assetValuationDate(2,"清算款","未清算");
        List<assetValuationDate> assetValuationList = new ArrayList();
        assetValuationList.add(assetValuation);
        assetValuationList.add(assetValuation1);
        return assetValuationList;
    }

    @Override
    public List<AssetValuationMjoinS> selectStockarket(String dateTime, String fundId) {
        System.out.println("这是impl类参数值是"+dateTime+fundId);
        Map map = new HashMap();
        map.put("dateTime",dateTime);
        map.put("fundId",fundId);
        List<AssetValuationMjoinS>  assetValuationMjoinS = assetValuationMapper.selectStockarket(map);
        return assetValuationMjoinS;
    }

    @Override
    public int delectSecurityAccrualStock(SecurityAccrualStock securityAccrualStock) {

        int i = assetValuationMapper.delectSecurityAccrualStock(securityAccrualStock);
        return i;
    }

    @Override
    public List<DealData> selectTransactionData(String deteTime,String fundId) {
        Map map = new HashMap();
        map.put("deteTime",deteTime);
        map.put("fundId",fundId);
        List<DealData> dealData = assetValuationMapper.selectTransactionData(map);
        return dealData;
    }

    @Override
    public List<Ta> selectTa(String deteTime,String  fundId) {
        Map map = new HashMap();
        map.put("deteTime",deteTime);
        map.put("fundId",fundId);
        List<Ta> tas = assetValuationMapper.selectTa(map);
        return tas;
    }

    @Override
    public int delectCashAccrualStock(CashAccrualStock cashAccrualStock) {
        int i = assetValuationMapper.delectCashAccrualStock(cashAccrualStock);
        return i;
    }


}
